package com.william.jdbcplus.boot.test.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.william.jdbcplus.common.annotation.*;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 实例类，只是用于写代码实例
 */
@Data
@NoArgsConstructor
@Table("tenant_entity")
@TableIndexs({
        @TableIndex(isUnique = false, fields = {"clientId", "tenantId"}),
        @TableIndex(isUnique = false, fields = {"userId", "userName"})
})
@TableUks({
        @TableUk(fields = {"clientId", "tenantId"}),
        @TableUk(fields = {"userId", "userName"})
})
public class TenantEntity implements Entity {
    /**
     * 租户ID
     */
    @ApiModelProperty(hidden = true)
    @TableId(value = "id", type = IdType.GUID, size = 32)
    private String id;

    /**
     * 客户端id
     */
    @ApiModelProperty(hidden = true)
    private String clientId;

    /**
     * 用户id
     */
    @ApiModelProperty(hidden = true)
    private String userId;

    /**
     * 租户ID
     */
    @ApiModelProperty(hidden = true)
    private String tenantId;

    /**
     * 用户名
     */
    @ApiModelProperty(hidden = true)
    private String userName;

    /**
     * 账号
     */
    @ApiModelProperty(hidden = true)
    private String account;

    /**
     * 角色id
     */
    @ApiModelProperty(hidden = true)
    private String roleId;

    /**
     * 角色名
     */
    @ApiModelProperty(hidden = true)
    private String roleName;

    /**
     * 组织机构
     */
    @ApiModelProperty(hidden = true)
    private String orgCode;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private Integer createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private Integer updateUser;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 状态[1:正常]
     */
    @ApiModelProperty(value = "业务状态")
    private Integer status;

    /**
     * 状态[0:未删除,1:删除]
     */
    @TableLogic
    @ApiModelProperty(value = "是否已删除")
    private Integer isDeleted;
}
